package cn.demoncat.util.mq.entity;

import java.io.Serializable;

/**
 * MQ日志
 * 
 * @author 延晓磊
 *
 * @since 2018年8月10日
 */
public class MqLog implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private static final String LOG_TYPE = "MQ";
	
	// 类型
	private String type;
	// 消息：MqLogMsg
	private String msg;
	// 主题
	private String topic;
	// 消息ID
	private String id;
	// 消息内容：String | MqMessage
	private Object content;

	public MqLog(String msg, String topic, MqMessage content) {
		super();
		this.type = LOG_TYPE;
		this.msg = msg;
		this.topic = topic;
		this.content = content;
		this.id = content.getMsgId();
	}

	public MqLog(String msg, String topic, String content) {
		super();
		this.type = LOG_TYPE;
		this.msg = msg;
		this.topic = topic;
		this.content = content;
	}

	public MqLog() {
		super();
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getTopic() {
		return topic;
	}

	public void setTopic(String topic) {
		this.topic = topic;
	}

	public Object getContent() {
		return content;
	}

	public void setContent(Object content) {
		this.content = content;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Override
	public String toString() {
		return "MqLog{" +
				"type='" + type + '\'' +
				", msg='" + msg + '\'' +
				", topic='" + topic + '\'' +
				", id='" + id + '\'' +
				", content=" + content +
				'}';
	}
}
